<%@ page import="edu.polsl.bio.str.manager.logic.JobDispatcherBean" %>
<%@ page import="org.slf4j.Logger" %>
<%@ page import="org.slf4j.LoggerFactory" %>
<%@ page import="org.springframework.context.ApplicationContext" %>
<%@ page import="org.springframework.web.context.support.WebApplicationContextUtils" %>
<%@ page contentType="text/html;charset=UTF-8" language="java" %>

<%
  Logger log = LoggerFactory.getLogger("edu.polsl.dispatch.jsp");

  try {
    ApplicationContext context = WebApplicationContextUtils.getWebApplicationContext(this.getServletConfig().getServletContext());
    JobDispatcherBean jobDispatcherBean = (JobDispatcherBean) context.getBean("jobDispatcherBean");

    jobDispatcherBean.dispatchWaitingJobs();
  } catch (Exception e) {
    log.error("Exception occurred", e);
    throw e;
  }
%>